﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Yammu.Core.VirtualFileSystem
{
    /// <summary>
    /// Abstracts a file or a directory on the virtual file system 
    /// </summary>
    public interface IVFSItem
    {
        /// <summary>
        /// @todo revisit this item.. do we need this?
        /// </summary>
        /// <param name="vpath"></param>
        void SetVirtualPath(string vpath);

        /// <summary>
        /// Returns true if this object represents a directory
        /// </summary>
        bool IsDirectory { get; }

        /// <summary>
        /// Returns the name and extension of the item excluding the path information
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Returns the complete path of the item.  Note that given this path and the corresponding provider, one should be
        /// able to access the actual physical item. e.g., if the VirtualPath returns /media and the provider is a ftp provider then
        /// one should be able to call provider.GetDirectory(path returned by virtualpath). This data will be stored by
        /// the location services to
        /// </summary>
        string VirtualPath { get; }

        /// <summary>
        /// Returns a readonly stream to the item
        /// </summary>
        /// <returns></returns>
        Stream Open();

        IList<IVFSItem> Children { get; }

        IList<IVFSItem> Directories { get; }


        IList<IVFSItem> Files { get; }
    }

}
